<?php
/**
 * ===============================================
 * 版权所有 2019-2050 青岛铁锤科技有限公司，并保留所有权利。
 * 网站地址: http://www.huaxianling.com
 * ===============================================
 * Author: Rag Hu
 * Created Time: 2019/7/18 19:42
 * Modified Time: 2019/7/18 19:42
 * Version: 2.0
 */

namespace App\Models;


use Illuminate\Database\Eloquent\Model;

class MemberCardFlow extends Model
{
    protected $table = 'member_card_flow';

    protected $guarded = [];

    //关联订单
    public function order()
    {
        return $this->hasOne(Order::class,'id','order_id');
    }


    public function card(){
        return $this->hasOne(MemberCard::class,'id','card_id');
    }


    public function member(){
        return $this->hasOne(Member::class, 'id', 'member_id');
    }

    public function user(){
        return $this->belongsTo(User::class, 'user_id','id');
    }

    public function royalty()
    {
        return $this->hasOne(Royalty::class,'item_id','id');
    }
}
